<template>
  <div class="item">
    <a :href="itemInfo.link">
      <van-image :src="itemInfo.image">
        <template v-slot:loading>
          <van-loading type="spinner" size="40" />
        </template>
      </van-image>
      <div class="item-title">{{ itemInfo.title }}</div>
    </a>
  </div>
</template>

<script>
export default {
  name: "categoryitem",
  props: {
    itemInfo: Object,
  },
  mounted() {
    //被创建了28次，所以监听了28次
    // this.$bus.$on("leftitemclick", (index) => {
    //   console.log("我监听了", index);
    // });
  },
  methods() {},
};
</script>

<style scoped>
.item {
  width: 33%;
  padding: 10px;
}
.item-title {
  text-align: center;
  font-size: 13px;
}
</style>